/**
 * HibernateUtil.java
 *
 * @author
 *
 * 08.04.2011
 *
 */

package at.fhv.easyDietWeb.server.hibernate;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HibernateUtil
{
	private static HibernateUtil _instance;
	private SessionFactory _session;

	private HibernateUtil()
	{
		Configuration conf = new Configuration().configure();
		_session = conf.buildSessionFactory();
	}

	public static HibernateUtil getInstance()
	{
		if (_instance == null)
		{
			_instance = new HibernateUtil();
		}
		return _instance;
	}

	public SessionFactory getSessionFactory()
	{
		return _session;
	}
}